<%@ page import="com.pubg.entity.User" %>
<%@ page import="com.pubg.entity.ProductType" %>
<%@ page import="java.util.List" %>
<%@ page import="com.pubg.entity.Product" %>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" +
            request.getServerName() + ":" +
            request.getServerPort() + path + "/";
%>
<html>
  <head>
    <title>PUBG页面</title>
  </head>
  <body>
  </body>
</html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>index</title>
    <link rel="stylesheet" type="text/css" href="css/reset.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/head.css">
    <script type="text/javascript" src="./js/JQuery.js"></script>
    <script type="text/javascript" src="./js/head.js"></script>
    <script type="text/javascript" src="./js/index.js"></script>
    <style type="text/css">
        img {
            vertical-align: middle;
        }
    </style>
</head>
<body>
<%
    List<ProductType> typeList = (List<ProductType>) session.getAttribute("typeList");
    if (typeList == null){
        request.getRequestDispatcher("main?opr=typeList").forward(request,response);
        return;
    }
    User user_admin = (User) session.getAttribute("user_admin");

    List<Product> products = (List<Product>) request.getAttribute("productList");
    if (products == null){
        request.getRequestDispatcher("main?opr=productList").forward(request,response);
        return;
    }
    System.out.println(products.size()+"+???343");

%>
<!-- 头部 -->
<header id="top">
    <div class="topList">
        <!-- 切换地址 -->
        <div class="address">
            <span>北京</span>
            <div class="top_show addressList">
                <ul>
                    <li class="province"><a href="javascript:" class="add_checked">北京</a></li>
                    <li class="province"><a href="javascript:">上海</a></li>
                    <li class="province"><a href="javascript:">天津</a></li>
                    <li class="province"><a href="javascript:">重庆</a></li>
                    <li class="province"><a href="javascript:">河北</a></li>
                    <li class="province"><a href="javascript:">山西</a></li>
                    <li class="province"><a href="javascript:">河南</a></li>
                    <li class="province"><a href="javascript:">辽宁</a></li>
                    <li class="province"><a href="javascript:">吉林</a></li>
                    <li class="province"><a href="javascript:">黑龙江</a></li>
                    <li class="province"><a href="javascript:">内蒙古</a></li>
                    <li class="province"><a href="javascript:">江苏</a></li>
                    <li class="province"><a href="javascript:">山东</a></li>
                    <li class="province"><a href="javascript:">安徽</a></li>
                    <li class="province"><a href="javascript:">浙江</a></li>
                    <li class="province"><a href="javascript:">福建</a></li>
                    <li class="province"><a href="javascript:">湖北</a></li>
                    <li class="province"><a href="javascript:">湖南</a></li>
                    <li class="province"><a href="javascript:">广东</a></li>
                    <li class="province"><a href="javascript:">广西</a></li>
                    <li class="province"><a href="javascript:">江西</a></li>
                    <li class="province"><a href="javascript:">四川</a></li>
                    <li class="province"><a href="javascript:">海南</a></li>
                    <li class="province"><a href="javascript:">贵州</a></li>
                    <li class="province"><a href="javascript:">云南</a></li>
                    <li class="province"><a href="javascript:">西藏</a></li>
                    <li class="province"><a href="javascript:">陕西</a></li>
                    <li class="province"><a href="javascript:">甘肃</a></li>
                    <li class="province"><a href="javascript:">青海</a></li>
                    <li class="province"><a href="javascript:">宁夏</a></li>
                    <li class="province"><a href="javascript:">新疆</a></li>
                    <li class="province"><a href="javascript:">港澳</a></li>
                    <li class="province"><a href="javascript:">台湾</a></li>
                    <li class="province"><a href="javascript:">钓鱼岛</a></li>
                    <li class="province"><a href="javascript:">海外</a></li>
                </ul>
            </div>
        </div>

        <!-- 切换地址结束 -->
        <!-- 顶部右边列表 -->
        <ul class="topNav">
            <li class="rabbit hover">
                <a href="login.html" id="tipLogin">你好，请登录</a>

            </li>
            <li><a href="">我的订单</a>&nbsp;&nbsp;|&nbsp;</li>
            <li class="myDong hover">
                <a href="javascript:">我的京东</a>&nbsp;&nbsp;|&nbsp;
                <div class='navShow'>
                    <div class="dong_top">
                        <p><span>待处理订单</span> <em>消息 </em></p>
                        <p><span>降价商品 </span><em> 返修退换货</em></p>
                        <p><span>我的问答</span> <em>我的关注</em></p>
                    </div>
                    <hr/>
                    <div class="dong_bottom">
                        <p><span>我的京豆</span> <em>我的白条</em></p>
                        <p><span>我的优惠券</span> <em>我的理财</em></p>
                    </div>
                </div>
            </li>
            <li><a href="javascript:">京东会员</a>&nbsp;&nbsp;|&nbsp;</li>
            <li class="service hover">
                <a href="javascript:">客户服务</a>&nbsp;&nbsp;|&nbsp;
                <div class='navShow'>
                    <div class="service_top">
                        <h4>客户</h4>
                        <p><span>帮助中心 </span><em> 售后服务</em></p>
                        <p><span>在线客服</span> <em>意见建议</em></p>
                        <p><span>电话客服</span> <em>客服邮箱</em></p>
                        <p>金融咨询</p>
                    </div>
                    <hr/>
                    <div class="service_bottom">
                        <h4>商户</h4>
                        <p><span>合作招商</span> <em>京东商学院</em></p>
                    </div>
                </div>
            </li>
            <li class="website">
                <div class='navShow'>
                    <dl>
                        <dt>特色主题</dt>
                        <dd>
                            <ul>
                                <li><a href="javascript:">品牌头条</a></li>
                                <li><a href="javascript:">发现好货</a></li>
                                <li><a href="javascript:">京东预售</a></li>
                                <li><a href="javascript:">尖er货</a></li>
                                <li><a href="javascript:">京东试用</a></li>
                                <li><a href="javascript:">港澳售</a></li>
                                <li><a href="javascript:">优惠券</a></li>
                                <li><a href="javascript:">闪购</a></li>
                                <li><a href="javascript:">秒杀</a></li>
                                <li><a href="javascript:">定期送</a></li>
                                <li><a href="javascript:">装机大师</a></li>
                                <li><a href="javascript:">新奇特</a></li>
                                <li><a href="javascript:">企业</a></li>
                                <li><a href="javascript:">金融服务</a></li>
                                <li><a href="javascript:">礼品购</a></li>
                            </ul>
                        </dd>
                    </dl>
                    <dl>
                        <dt>行业频道</dt>
                        <dd>
                            <ul>
                                <li><a href="javascript:">品牌头条</a></li>
                                <li><a href="javascript:">发现好货</a></li>
                                <li><a href="javascript:">京东预售</a></li>
                                <li><a href="javascript:">尖er货</a></li>
                                <li><a href="javascript:">京东试用</a></li>
                                <li><a href="javascript:">港澳售</a></li>
                                <li><a href="javascript:">优惠券</a></li>
                                <li><a href="javascript:">闪购</a></li>
                                <li><a href="javascript:">秒杀</a></li>
                                <li><a href="javascript:">定期送</a></li>
                                <li><a href="javascript:">装机大师</a></li>
                                <li><a href="javascript:">新奇特</a></li>
                                <li><a href="javascript:">企业</a></li>
                                <li><a href="javascript:">金融服务</a></li>
                                <li><a href="javascript:">礼品购</a></li>
                            </ul>
                        </dd>
                    </dl>
                    <dl>
                        <dt>生活服务</dt>
                        <dd>
                            <ul>
                                <li><a href="javascript:">品牌头条</a></li>
                                <li><a href="javascript:">发现好货</a></li>
                                <li><a href="javascript:">京东预售</a></li>
                                <li><a href="javascript:">尖er货</a></li>
                                <li><a href="javascript:">京东试用</a></li>
                                <li><a href="javascript:">港澳售</a></li>
                                <li><a href="javascript:">优惠券</a></li>
                                <li><a href="javascript:">闪购</a></li>
                                <li><a href="javascript:">秒杀</a></li>
                                <li><a href="javascript:">定期送</a></li>
                                <li><a href="javascript:">装机大师</a></li>
                                <li><a href="javascript:">新奇特</a></li>
                                <li><a href="javascript:">企业</a></li>
                                <li><a href="javascript:">金融服务</a></li>
                                <li><a href="javascript:">礼品购</a></li>
                            </ul>
                        </dd>
                    </dl>
                    <dl>
                        <dt>更多精选</dt>
                        <dd>
                            <ul>
                                <li><a href="javascript:">品牌头条</a></li>
                                <li><a href="javascript:">发现好货</a></li>
                                <li><a href="javascript:">京东预售</a></li>
                                <li><a href="javascript:">尖er货</a></li>
                                <li><a href="javascript:">京东试用</a></li>
                                <li><a href="javascript:">港澳售</a></li>
                                <li><a href="javascript:">优惠券</a></li>
                                <li><a href="javascript:">闪购</a></li>
                                <li><a href="javascript:">秒杀</a></li>
                                <li><a href="javascript:">定期送</a></li>
                                <li><a href="javascript:">装机大师</a></li>
                                <li><a href="javascript:">新奇特</a></li>
                                <li><a href="javascript:">企业</a></li>
                                <li><a href="javascript:">金融服务</a></li>
                                <li><a href="javascript:">礼品购</a></li>
                            </ul>
                        </dd>
                    </dl>
                </div>
            </li>
            <li class="phone_Jing">
                <%--进入后台管理页面--%>
                <a id="afterManage" style="display: none;" href="javascript:">后台管理</a>
                <div class="wei"><img src="./images/index_images/wei.jpg" alt=""/></div>
            </li>
            <li class="clear"></li>
        </ul>
        <!-- 顶部右边列表结束 -->
    </div>
    <div class="JingDong">
        <img src="./images/index_images/JingDong.jpg" alt=""/>
    </div>
</header>

<!-- 滚动时上边固定列表 -->
<section id="topFixed">
    <div>
        <%--login的部分--%>
        <a href="javascript:"><img src="./images/index_images/top_jing.jpg" alt=""/></a>
        <div class="search">
            <input type="text" placeholder="音响"/>
            <span></span>
        </div>
    </div>
</section>

<!-- 滚动时左边固定列表 -->
<section id="leftFixed">
    <ul>
        <li class="active"><a href="javascript:enjoy">享品质</a></li>
        <li><a href="#life">服饰美妆</a></li>
        <li><a href="#phone">家电手机</a></li>
        <li><a href="#computer">电脑数码</a></li>
        <li><a href="#sport">3C运动</a></li>
        <li><a href="#eat">爱吃</a></li>
        <li><a href="#mom">母婴家居</a></li>
        <li><a href="#book">图书汽车</a></li>
        <li><a href="#virtual">虚拟</a></li>
        <li><a href="#enough">还没逛够</a></li>
        <li class="top"><a href="javascript:">顶部</a></li>
    </ul>
</section>

<!-- 右边固定列表 -->
<section id="rightFixed">
    <ul class="topList">
        <li>
            <div class="listShow">京东会员</div>
        </li>
        <li>
            <div class="listShow">购物车</div>
        </li>
        <li>
            <div class="listShow">我的关注</div>
        </li>
        <li>
            <div class="listShow">我的足迹</div>
        </li>
        <li>
            <div class="listShow">我的消息</div>
        </li>
        <li>
            <div class="listShow">咨询JIMI</div>
        </li>
    </ul>
    <ul class="belowList">
        <li class="top">
            <div class="listShow top">顶部</div>
        </li>
        <li>
            <div class="listShow">反馈</div>
        </li>
    </ul>
</section>

<!-- 内容 -->
<div id="container">
    <!-- 顶部搜索区域 -->
    <section id="search">
        <div class="searchBar">
            <input type="text" placeholder="白酒"/>
            <div></div>
            <div class="shoppingCar">
                <a href="javascript:">我的购物车<span>0</span></a>
                <div class="showCar">
                    购物车中还没有商品，赶紧选购吧！
                </div>
            </div>
            <p>
                <a href="javascript:">玩物盛典</a><a href="javascript:">立省3000</a><a href="javascript:">申慧兽药</a><a
                    href="javascript:">眼镜节</a><a href="javascript:">家电秒杀</a><a href="javascript:">休闲零食</a><a
                    href="javascript:">夹克男秋款</a><a href="javascript:">满199减100</a>
            </p>
        </div>
        <ul class="searchList">
            <li><a href="javascript:">秒杀</a></li>
            <li><a href="javascript:">优惠券</a></li>
            <li><a href="javascript:">闪购</a></li>
            <li><a href="javascript:">拍卖</a></li>
            <li><a href="javascript:">服装城</a></li>
            <li><a href="javascript:">京东超市<img src="./images/index_images/top_two_baby.png" alt=""/></a></li>
            <li><a href="javascript:">生鲜</a></li>
            <li><a href="javascript:">全球购</a></li>
            <li><a href="javascript:">京东金融</a></li>
        </ul>
    </section>
    <!-- 顶部搜索区域结束 -->

    <!-- 广告主体 -->
    <section id="main">
        <!-- 左边列表导航 -->
        <%--分类列表--%>
        <div class="leftSide">
            <ul style="background-color: #ff312e;color: #fff;height: 480px;width: 190px">
                <%
                    for (ProductType type : typeList){
                %>
                    <li style="font-size: 20px;text-indent: 1.8em;margin: 25px 0"><%=type.getName()%></li>
                <%
                    }
                %>
            </ul>
        </div>
        <!-- 左边列表导航结束 -->

        <!-- 中间轮播图区域 -->
        <div class="carousel">
            <div class="carouselBox">
                <div class="ads">
                    <img src="./images/index_images/ad1.jpg" alt=""/>
                    <img src="./images/index_images/ad2.jpg" alt=""/>
                    <img src="./images/index_images/ad3.jpg" alt=""/>
                    <img src="./images/index_images/ad4.jpg" alt=""/>
                    <img src="./images/index_images/ad5.jpg" alt=""/>
                    <img src="./images/index_images/ad6.jpg" alt=""/>
                </div>
                <ul class="doll">
                    <li class="sec"></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
            <div class="carouselBelow">
                <a href="javascript:"><img src="./images/index_images/ad_below1.jpg" alt=""/></a>
                <a href="javascript:"><img src="./images/index_images/ad_below2.jpg" alt=""/></a>
            </div>
        </div>
        <!-- 中间轮播图区域结束 -->

        <!-- 右边用户区域 -->
        <div class="rightSide">
            <div class="user">
                <%--用户名输入的地方--%>
                <a href="#" id="userName"></a>
                <script type="text/javascript" src="js/JQuery.js"></script>
                <script type="text/javascript">
                    $(function () {
                        <%
                            if (user_admin == null){
                        %>
                            // 未登录
                            $("#tipLogin").text("你好，请登录");
                        <%

                            }else if (user_admin.getType() ==1){
                                //管理员登陆
                         %>
                            $("#tipLogin").text("");
                            $("#userName").text("<%=user_admin.getLoginName()%>");
                            $("#afterManage").show();
                            $("#afterManage").click(function () {
                                location.href="<%=basePath%>loginAfter/backManage/backIndex.jsp";
                            })
                        <%
                            }else{
                                //普通用户登陆
                         %>
                            $("#tipLogin").text("");
                            $("#userName").text(<%=user_admin.getLoginName()%>);
                         <%
                           }
                       %>

                    })


                </script>
            </div>
            <div class="sales">
                <div class="line">
                    <ul>
                        <li>
                            <a href="javascript:">促销</a>
                            <div class="show">

                            </div>
                        </li>
                        <li style="width:10px;">|</li>
                        <li>
                            <a href="javascript:">公告</a>
                            <div style="left: -50px;">

                            </div>
                        </li>
                    </ul>
                    <span><a href="javascript:">更多</a></span>
                    <div class="redLine"></div>
                </div>
            </div>
            <div class="table">
                <ul>
                    <li><a href="javascript:">话费</a></li>
                    <li><a href="javascript:">机票</a></li>
                    <li><a href="javascript:">酒店</a></li>
                    <li><a href="javascript:">游戏</a></li>
                    <li><a href="javascript:">企业购</a></li>
                    <li><a href="javascript:">加油卡</a></li>
                    <li><a href="javascript:">电影票</a></li>
                    <li><a href="javascript:">火车票</a></li>
                    <li><a href="javascript:">众筹</a></li>
                    <li><a href="javascript:">理财</a></li>
                    <li><a href="javascript:">礼品卡</a></li>
                    <li><a href="javascript:">白条</a></li>
                </ul>
            </div>
        </div>
        <!-- 右边用户区域结束 -->
    </section>

    <!--秒杀 -->
    <section id="secKill">
        <div class="secHead">
            <span><h2>京东秒杀</h2>总有你想不到的低价  <em>&gt;</em></span>
            <div class="time">
                <span>当前场次</span>
                <div class="clock">
                    <span class="hour">00</span>
                    <span>:</span>
                    <span class="min">00</span>
                    <span>:</span>
                    <span class="sec">00</span>
                </div>
                <em>后结束抢购</em>
            </div>
        </div>
        <div class="secBody">
            <div class="dir dirl">&lt;</div>
            <div class="dir dirr">&gt;</div>

            <div class="scrollImg">
                <div class="images">
                    <%
                        for (Product product : products) {
                            System.out.println("NU"+product.getName());
                    %>
                    <dl>
                        <dt><img src="<%=basePath%>upload/images/<%=product.getFileName()%>" width='150' height='150'/></dt>
                        <dd class='title' class="txt"><a href="" class="txt"><%=product.getName()%></a></dd>
                        <dd>￥<span><%=product.getPrice()%></span>
                            <del>￥<%=product.getPrice()+100%></del>
                        </dd>
                    </dl>
                    <%
                        }
                    %>
                </div>
            </div>
        </div>
    </section>

    <!-- 发现好货 -->


    <!-- 领券中心 -->


    <!-- 中间水平分广告 -->


    <!-- 享品质 -->


    <!-- 爱生活 -->


    <!-- 家电手机 -->


    <!-- 电脑数码 -->


    <!-- 3C运动 -->


    <!-- 中间水平分广告 -->
    <section class="device" style="margin: 30px 0;">
        <div class=" img deviceLeft"></div>
        <div class=" img deviceMiddle"></div>
        <div class=" img deviceRight"></div>
    </section>
    <!-- 爱吃 -->

    <!-- 母婴家居 -->

    <!-- 图书汽车 -->

    <!--虚拟-->

    <!--还没逛够-->

</div>
<!-- 内容结束 -->



<!--底部-->
<footer id="footer">
    <ul class="top_footer">
        <li>品类齐全，轻松购物</li>
        <li>多仓直发，极速配送</li>
        <li>正品行货，精致服务</li>
        <li>天天低价，畅选无忧</li>
    </ul>
    <div class="mid_footer">
        <dl>
            <dt>购物指南</dt>
            <dd><a href="javascript:">购物流程</a></dd>
            <dd><a href="javascript:">会员介绍</a></dd>
            <dd><a href="javascript:">生活旅行</a></dd>
            <dd><a href="javascript:">常见问题</a></dd>
            <dd><a href="javascript:">大家电</a></dd>
            <dd><a href="javascript:">联系客服</a></dd>
        </dl>
        <dl>
            <dt>配送方式</dt>
            <dd><a href="javascript:">上门自提</a></dd>
            <dd><a href="javascript:">211限时达</a></dd>
            <dd><a href="javascript:">配送服务查询</a></dd>
            <dd><a href="javascript:">配送费收取标准</a></dd>
            <dd><a href="javascript:">海外配</a></dd>
        </dl>
        <dl>
            <dt>支付方式</dt>
            <dd><a href="javascript:">货到付款</a></dd>
            <dd><a href="javascript:">在线支付</a></dd>
            <dd><a href="javascript:">分期付款</a></dd>
            <dd><a href="javascript:">公司转账</a></dd>
            <dd><a href="javascript:">邮局汇款</a></dd>
        </dl>
        <dl>
            <dt>售后服务</dt>
            <dd><a href="javascript:">售后政策</a></dd>
            <dd><a href="javascript:">价格保护</a></dd>
            <dd><a href="javascript:">退款说明</a></dd>
            <dd><a href="javascript:">返修/退换货</a></dd>
            <dd><a href="javascript:">取消订单</a></dd>
        </dl>
        <dl>
            <dt>特色服务</dt>
            <dd><a href="javascript:">夺宝岛</a></dd>
            <dd><a href="javascript:">DIY装机</a></dd>
            <dd><a href="javascript:">延保服务</a></dd>
            <dd><a href="javascript:">京东E卡</a></dd>
            <dd><a href="javascript:">京东通信</a></dd>
            <dd><a href="javascript:">京东JD+</a></dd>
        </dl>
    </div>
    <div class="bot_footer">
        <ul class="about">
            <li><a href="javascript:">关于我们</a></li>
            <li><a href="javascript:">联系我们</a></li>
            <li><a href="javascript:">联系客服</a></li>
            <li><a href="javascript:">合作招商</a></li>
            <li><a href="javascript:">商家帮助</a></li>
            <li><a href="javascript:">营销中心</a></li>
            <li><a href="javascript:">手机京东</a></li>
            <li><a href="javascript:">友情链接</a></li>
            <li><a href="javascript:">销售联盟</a></li>
            <li><a href="javascript:">京东社区</a></li>
            <li><a href="javascript:">风险监测</a></li>
            <li><a href="javascript:">隐私政策</a></li>
            <li><a href="javascript:">京东公益</a></li>
            <li><a href="javascript:">English Site</a></li>
            <li><a href="javascript:">Contact Us</a></li>
        </ul>
        <ul class="num num1">
            <li>京公网安备 11000002000088号 &nbsp;&nbsp;|</li>
            <li>京ICP证070359号 &nbsp;&nbsp;|</li>
            <li>互联网药品信息服务资格证编号(京)-经营性-2014-0008 &nbsp;&nbsp;|</li>
            <li>新出发京零 字第大120007号</li>
            <li class="clear"></li>
        </ul>
        <ul class="num num2">
            <li>互联网出版许可证编号新出网证(京)字150号 &nbsp;&nbsp;|</li>
            <li>出版物经营许可证 &nbsp;&nbsp;|</li>
            <li>网络文化经营许可证京网文[2014]2148-348号 &nbsp;&nbsp;|</li>
            <li>违法和不良信息举报电话：4006561155</li>
            <li class="clear"></li>
        </ul>
        <ul class="num num3">
            <li>Copyright © 2004 - 2017 京东JD.com 版权所有 &nbsp;&nbsp;|</li>
            <li>消费者维权热线：4006067733经营证照</li>
            <li class="clear"></li>
        </ul>
        <ul class="num num4">
            <li>京东旗下网站：京东钱包 &nbsp;&nbsp;|</li>
            <li>京东云</li>
            <li class="clear"></li>
        </ul>
        <div class="dls">
            <dl>
                <dt><img src="./images/index_images/prepare.png" alt=""/></dt>
                <dd>经营性网站备案信息</dd>
            </dl>
            <dl>
                <dt><img src="./images/index_images/believe.png" alt=""/></dt>
                <dd>可信网站信用评价</dd>
            </dl>
            <dl>
                <dt><img src="./images/index_images/police.png" alt=""/></dt>
                <dd>网络警察提醒您</dd>
            </dl>
            <dl>
                <dt><img src="./images/index_images/website.png" alt=""/></dt>
                <dd>诚信网站</dd>
            </dl>
            <dl>
                <dt><img src="./images/index_images/jubao.png" alt=""/></dt>
                <dd>中国互联网举报中心</dd>
            </dl>
            <dl>
                <dt><img src="./images/index_images/APP.png" alt=""/></dt>
                <dd>网络举报APP下载</dd>
            </dl>
        </div>
    </div>
    </div>
</footer>
</body>
</html>
